<template>
    <div class="canvas">
        <canvas id="canvas" style="transform: scale(0.6,0.6);transform-origin:9% 0px 0px"></canvas>
        <span>sdfsdfsdf</span>
        <span>在线 8人在房间</span>
        <span>游戏说明</span>
        <span v-on:click="addCoin()"><i></i>{{icon}}金币</span>
        <span class="switch"><i></i></span>
    </div>
</template>
<style lang="less">
    @import "../../less/Canvas";
</style>

<script>
    export default {
        components: {},
        data() {
            return {
                icon: 15
            }
        },
        methods: {
            addCoin() {
                this.$emit('addCoin');
                console.log('addCoin');
            }
        },
        mounted() {
            var canvas = document.getElementById("canvas")
            var url = 'ws://183.240.23.67:8080/new_wawaji_demo/WWJ_ZEGO_STREAM_32a03dd42e06_2'
            var player = new JSMpeg.Player(url, {canvas: canvas, audio: false});
            canvas.style.width = "300"
            canvas.style.height = "200"
        }
    }
</script>